package com.gitee.sop.order.strategy;

import com.alibaba.fastjson.JSONObject;
import com.gitee.sop.order.dto.OrderFormDto;
import com.gitee.sop.order.enums.OrderConstants;
import com.gitee.sop.order.strategy.common.AbstractOrderStrategy;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * 自运营订单策略处理类
 *
 * @author Admin
 */
@Component
public class OwnStrategy extends AbstractOrderStrategy {
    @Override
    public int getKey() {
        return OrderConstants.ORDER_BIZ_TYPE_SMS;
    }

    @Override
    public String createOrder(OrderFormDto query) {
        //根据不同的业务编码获取不同的业务价格配置
        //准备订单相关数据，生成对应的订单
        if (StringUtils.isNotBlank(query.getBizCode())) {

        }

        return null;
    }

    @Override
    public JSONObject cancel(String orderNumber, String thirdOrderNumber) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("status", 200);
        jsonObject.put("message", "操作成功");
        return jsonObject;
    }

    @Override
    public boolean paid(String orderNumber, String thirdOrderNumber, String paySerialNumber, BigDecimal totalPrice) {
        return true;
    }
}
